﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Tests.Integration.Instruments
{
    public static class ButtonExtension
    {
        public static void PerformClick(this Button extendee)
        {
            var b = new ButtonAutomationPeer(extendee);
            var invoker = b.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
            invoker.Invoke();
        }
    }
}
